//! @Author: DengLibin 榆霖
//! @Date:  2022-07-06 13:44:13
//! @Description: 跨域配置

use actix_cors::Cors;
use actix_web::http::header;

/// @Author: DengLibin 榆霖
/// @Date:  2022-07-06 13:48:03
/// @Description: 跨域配置
pub fn _cors() -> Cors{
    Cors::default()
    .allowed_origin("http://localhost")
    .allowed_methods(vec!["GET", "POST", "OPTION"])
    .allowed_headers(vec![header::AUTHORIZATION, header::ACCEPT, header::ORIGIN])
    .allowed_header(header::CONTENT_TYPE)
    .supports_credentials()
    .max_age(3600)
}